home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 24
/
Amiga Format AFCD24 (Feb 1998, Issue 108).iso
/
-seriously_amiga-
/
shareware
/
programming
/
other
/
pmdev
/
include
/
libraries
/
pm.h
Wrap
C/C++ Source or Header
|
1998-01-05
|
7KB
|
220 lines
//
// $VER: pm.h 7.0 (9.11.97)
//
// Library base, tags and macro definitions
// for popupmenu.library.
//
// ©1996-1997 Henrik Isaksson
// All Rights Reserved.
//
#ifndef LIBRARIES_POPUPMENU_H
#define LIBRARIES_POPUPMENU_H
#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h>
#endif
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif
//
// Tags passed to PM_OpenPopupMenuA and PM_FilterIMsgA
//
#define PM_Menu (TAG_USER+4) // (struct PopupMenu *) Pointer to menulist initialized by MakeMenu()
#define PM_Top (TAG_USER+12) // (LONG) Top (Y) position
#define PM_Left (TAG_USER+13) // (LONG) Left (X) position
#define PM_Code (TAG_USER+14) // (UWORD) Read the documentation.
//#define PM_Right (TAG_USER+15)
//#define PM_Bottom (TAG_USER+16)
//#define PM_MinWidth (TAG_USER+17)
//#define PM_MinHeight (TAG_USER+18)
//#define PM_ForceFont (TAG_USER+19)
#define PM_PullDown (TAG_USER+90) // (BOOL) Make the menu a pulldown menu.
#define PM_MenuHandler (TAG_USER+91) // (struct Hook *) Hook that is called for each selected item, after the
// menu has been closed. This tag turns on MultiSelect.
#define PM_AutoPullDown (TAG_USER+92) // Make an automatic pulldown menu. (PM_FilterIMsg only)
#define PM_LocaleHook (TAG_USER+93) // Locale "GetString()" hook.
//
// Tags passed to MakeItem
//
#define PM_Title (TAG_USER+20) // Item title
#define PM_UserData (TAG_USER+21) // Anything, returned by OpenPopupMenu when this item is selected
#define PM_ID (TAG_USER+22) // ID number, if you want to access this item later
#define PM_Sub (TAG_USER+23) // Pointer to submenu list (from MakeMenu)
#define PM_Flags (TAG_USER+24) // For internal use
#define PM_NoSelect (TAG_USER+25) // Make the item unselectable
#define PM_FillPen (TAG_USER+26) // Make the item appear in FILLPEN
#define PM_Checkit (TAG_USER+27) // Leave space for a checkmark
#define PM_Checked (TAG_USER+28) // Make this item is checked
#define PM_Italic (TAG_USER+29) // Italic text
#define PM_Bold (TAG_USER+30) // Bold text
#define PM_Underlined (TAG_USER+31) // Underlined text
#define PM_TitleBar (TAG_USER+32) // Horizontal separator bar
#define PM_WideTitleBar (TAG_USER+33) // Same as above, but full width
#define PM_ShadowPen (TAG_USER+34) // Draw text in SHADOWPEN
#define PM_ShinePen (TAG_USER+35) // Draw text in SHINEPEN
#define PM_Center (TAG_USER+36) // Center the text of this item
#define PM_Exclude (TAG_USER+37) // Items to unselect (or select) when this gets selected
#define PM_Disabled (TAG_USER+38) // Disable an item
#define PM_ImageSelected (TAG_USER+39) // Image when selected, PM_Title will be render on top of the image
#define PM_ImageUnselected (TAG_USER+40) // Image when unselected
#define PM_IconSelected (TAG_USER+41) // Icon when selected
#define PM_IconUnselected (TAG_USER+42) // Icon when unselected
//#define PM_ImageMode (TAG_USER+43)
#define PM_AutoStore (TAG_USER+44) // Pointer to BOOL reflecting the current state of the item
#define PM_TextPen (TAG_USER+45) // Pen number for text colour of this item, if you want to allocate a pen yourself
#define PM_Meaning (TAG_USER+46) // Lets the user select text style, colour and icon for this item.
#define PM_CommKey (TAG_USER+47) // Keyboard shortcut for this item.
#define PM_Shadowed (TAG_USER+48) // Gives the text a shadow
#define PM_LocaleTitle (TAG_USER+49) // Locale string ID
#define PM_BuiltInIcon (TAG_USER+59) // Built-in Icon
#define PM_ColourBox (TAG_USER+60) // Filled rectangle
//
// Tags passed to MakeMenu
//
#define PM_Item (TAG_USER+50) // Item pointer from MakeItem
#define PM_Dummy (TAG_USER+51) // Sometimes very useful
//
// Tags passed to MakeIDList
//
#define PM_ExcludeID (TAG_USER+55) // ID number of menu to deselect when this gets selected
#define PM_IncludeID (TAG_USER+56) // ID number of menu to select when this gets selected
#define PM_ReflectID (TAG_USER+57) // ID number of menu that should reflect the state of this one
#define PM_InverseID (TAG_USER+58) // ID number of menu to inverse reflect the state of this one
//
// Built-In Icons
//
#define PMIMG_CHECKMARK 100
#define PMIMG_SUBMENU 101
#define PMIMG_EXCLUDE 102
#define PMIMG_AMIGA 103
#define PMIMG_NEW 104
#define PMIMG_OPEN 105
#define PMIMG_SAVE 106
#define PMIMG_PRINT 107
#define PMIMG_ABOUT 108
#define PMIMG_QUIT 109
#define PMIMG_CUT 110
#define PMIMG_COPY 111
#define PMIMG_PASTE 112
#define PMIMG_ERASE 113
#define PMIMG_UNDO 114
#define PMIMG_REDO 115
#define PMIMG_NEXT 116
#define PMIMG_PREV 117
#define PMIMG_SEARCH 118
#define PMIMG_VIEW 119
#define PMIMG_GRID 120
#define PMIMG_ZOOMIN 121
#define PMIMG_ZOOMOUT 122
#define PMIMG_HELP 123
#define PMIMG_HIDE 124
#define PMIMG_INFORMATION 125
#define PMIMG_PLAY 126
#define PMIMG_ADD 127
#define PMIMG_INSERT 128
//
// Macros
//
#define PMMenu(t) PM_MakeMenu(PM_Item, PM_MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, PM_Shadowed, TRUE, PM_Center, TRUE, TAG_DONE),\
PM_Item, PM_MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define PMSubMenu(t) PM_Sub, PM_MakeMenu(PM_Item, PM_MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, TAG_DONE),\
PM_Item, PM_MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define PMSimpleSub PM_Sub, PM_MakeMenu(PM_Dummy, 0
#define PMItem(t) PM_Item, PM_MakeItem(PM_Title, t
#define PMInfo(t) PM_Item, PM_MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE
#define PMBar PM_Item, PM_MakeItem(PM_TitleBar, TRUE
#define PMTitleBar PMBar
#define PMNarrowBar PM_Item, PM_MakeItem(PM_TitleBar, TRUE
#define PMNarrowTitleBar PMNarrowBar
#define PMMenuTitle(t) PM_Item, PM_MakeItem(PM_Title, t, PM_NoSelect, TRUE, PM_ShinePen, TRUE, PM_Shadowed, TRUE, PM_Center, TRUE, TAG_DONE),\
PM_Item, PM_MakeItem(PM_WideTitleBar, TRUE, TAG_DONE)
#define PMExcl PM_Exclude, PM_MakeIDList(
#define ExID(id) PM_ExcludeID, id
#define InID(id) PM_IncludeID, id
#define RefID(id) PM_ReflectID, id
#define InvID(id) PM_InverseID, id
#define PMCheckItem(t,id) PM_Item, PM_MakeItem(PM_Title, t, PM_ID, id, PM_Checkit, TRUE
#define PMEnd TAG_DONE)
#ifndef End
#define End TAG_DONE)
#endif
#define PMERR (-5L)
//
// Library base
//
#ifndef PM_NOBASE
struct PopupMenuBase {
struct Library pmb_Library;
ULONG pmb_SegList;
ULONG pmb_Flags;
struct Library *pmb_ExecBase;
struct Library *pmb_UtilityBase;
struct Library *pmb_IntuitionBase;
struct Library *pmb_GfxBase;
struct Library *pmb_DOSBase;
BOOL pmb_NewPrefs;
struct Library *pmb_CxBase;
};
#endif
#define POPUPMENU_VERSION 6L
#define POPUPMENU_NAME "popupmenu.library"
//
// PopupMenu structure
//
// WARNING!
// This structure may change in future versions.
// Do not rely on anything below "UserData".
//
#ifndef PMPRIV_H
struct PopupMenu {
struct PopupMenu *Next;
struct PopupMenu *Sub;
STRPTR Title; // Title
ULONG Flags;
ULONG ID; // Item ID
APTR UserData; // UserData
ULONG TextPen;
BOOL *AutoSetPtr;
struct PM_IDLst *Exclude;
LONG Top;
LONG Height;
struct Image *SelImg;
struct Image *UnSelImg;
struct Image *SelIcon;
struct Image *UnSelIcon;
UBYTE CommKey;
};
#endif
#endif